home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / biz / demo / mrback_b_demo114.lha / ARexx_Scripts / testall.mrbk < prev    next >
Text File  |  1991-01-12  |  5KB  |  219 lines

  1. /* testall.mrbk */
  2.  
  3. /* This ARexx program attempts to test all of MRBackup's ARexx
  4.  * capabilities.
  5.  * 
  6.  * Note: you will notice that several of MRBackup's ARexx commands
  7.  * require syntax of the following form:
  8.  *
  9.  *  'somecommand "Quoted string"'
  10.  *
  11.  * This inhibits ARexx from evaluating the "Quoted string" and removing the
  12.  * quotes.
  13.  */
  14.  
  15. signal on ERROR
  16. signal on BREAK_C
  17.  
  18. options results
  19.  
  20. if ~(Show('P', 'MRBackup_#1')) then do
  21.     say "You must run MRBackup first. With a little work, you could"
  22.     say "get this ARexx script to do it for you."
  23.     exit 1
  24. end
  25.  
  26. address "MRBackup_#1"
  27.  
  28. poptofront  /* Bring MRBackup's screen to the front. */
  29.  
  30. 'setinfogadget "This is a test of MRBackup ARexx capabilities. Hold onto your hat!"'
  31. call Delay(50)
  32.  
  33. /* Diddle the Test Date field. */
  34.  
  35. 'gettestdate'
  36. msg = "Current test date = " || result
  37. say msg
  38. 'setinfogadget' '"'msg'"'
  39. call Delay(50)
  40. 'settestdate'
  41. 'gettestdate'
  42. msg = "New test date = " || result
  43. 'setinfogadget' '"'msg'"'
  44. call Delay(50)
  45.  
  46. /* Muck about with the Home Path setting. */
  47.  
  48. 'gethomepath'
  49. msg = "Current Home Path = " || result
  50. 'setinfogadget' '"'msg'"'
  51. call Delay(50)
  52.  
  53. msg = "Setting Home Path to T:"
  54. 'setinfogadget' '"'msg'"'
  55. call Delay(50)
  56. 'sethomepath "T:"'
  57. call Delay(50)
  58.  
  59. 'setinfogadget "Setting Home Path by requester."'
  60. call Delay(50)
  61. 'sethomepath'
  62. msg = "New Home Path = " || result
  63. 'setinfogadget' '"'msg'"'
  64. call Delay(50)
  65.  
  66. 'setinfogadget "Setting Backup Path to SYS:"'
  67. call Delay(50)
  68. 'setbackpath "SYS:"'
  69. msg = "New Backup Path = " || result
  70. 'setinfogadget' '"'msg'"'
  71. call Delay(50)
  72.  
  73. 'setinfogadget "Setting Backup Path by requester."'
  74. call Delay(50)
  75. 'setbackpath'
  76. msg = "New Backup Path = " || result
  77. 'setinfogadget' '"'msg'"'
  78. call Delay(50)
  79.  
  80. 'setinfogadget "Setting Backup Filter"'
  81. 'setbfilterpath "BackupFilter"'
  82. call Delay(50)
  83.  
  84. 'setinfogadget "Setting Backup Filter by requester."'
  85. call Delay(50)
  86. 'setbfilterpath'
  87. call Delay(50)
  88.  
  89. 'notealert "Setting Compression Filter directly."'
  90. 'setcfilterpath "NoSuchFileName"'
  91. 'notealert "Setting Compression Filter by requester."'
  92. 'setcfilterpath'
  93. /* 
  94. msg = "Final compression filter path is " || result
  95. 'notealert' '"'msg'"'
  96. */
  97. 'notealert "Setting decompression filter directly."'
  98. 'setdfilterpath "NoSuchFileName"'
  99. 'notealert "Setting decompression filter by requester."'
  100. 'setdfilterpath'
  101.  
  102. /*
  103. msg = "Final decompression filter path is " || '0A'X || result
  104. 'notealert' '"'msg'"'
  105. */
  106.  
  107. 'notealert "Setting listing path directly."'
  108. 'setlistpath "PRT:"'
  109. 'notealert "Setting listing path by requester."'
  110. 'setlistpath'
  111.  
  112. 'notealert "Setting log path directly."'
  113. 'setlogpath "T:mrbackup.log"'
  114. 'notealert "Setting log path by requester."'
  115. 'setlogpath'
  116.  
  117. 'setinfogadget "I will now toggle the button options"'
  118.  
  119. 'notealert "Toggling the Voice option."'
  120. 'setvoice "no"'
  121. call Delay(50)
  122. 'setvoice "yes"'
  123. 'speak "If you can''t hear this, something is wrong."'
  124.  
  125. 'notealert "Toggling the Listing option."'
  126. 'listing "no"'
  127. call Delay(50)
  128. 'listing "yes"'
  129.  
  130. 'notealert "Toggling the Split Big Files option."'
  131. 'splitfiles "no"'
  132. call Delay(50)
  133. 'splitfiles "yes"'
  134.  
  135. 'notealert "Toggling the Test Archive Bits option."'
  136. 'testarcbits "no"'
  137. call Delay(50)
  138. 'testarcbits "yes"'
  139.  
  140. 'notealert "Toggling the Set Archive Bits option."'
  141. 'setarcbits "no"'
  142. call Delay(50)
  143. 'setarcbits "yes"'
  144. call Delay(50)
  145.  
  146. 'notealert "Changing the buffer size."'
  147.  
  148. 'getbufsize'
  149. msg = "Current buffer size = " || result || "K."
  150. 'notealert' '"'msg'"'
  151.  
  152. 'setbufsize 64'
  153. msg = "New buffer size = " || result || "K."
  154. 'notealert' '"'msg'"'
  155.  
  156. rc = 0
  157. 'setinfogadget "ARexx testing - cycling Compression and Decompression options."'
  158.  
  159. getcompression
  160. say "Current compression option: " || result
  161.  
  162. getdecompression
  163. say "Current decompression option: " || result
  164.  
  165. /* Cycle through the allowable compression/decompression options. */
  166.  
  167. coptions = ""
  168. coptions.1 = "None"
  169. coptions.2 = "12-Bit"
  170. coptions.3 = "13-Bit"
  171. coptions.4 = "14-Bit"
  172. coptions.5 = "15-Bit"
  173. coptions.6 = "16-Bit"
  174.  
  175. do i=1 to 6
  176.     /* say "i = " || i */
  177.     /* say "coptions.i = " || coptions.i */
  178.     
  179.     /* say "Setting compression to " || coptions.i */
  180.     setcompression coptions.i
  181.     getcompression
  182.     if result ~= coptions.i then do
  183.         say "setcompression " || coptions.i " failed; rc = " || rc
  184.         exit rc
  185.     end
  186.     /* say "Setting decompression to " || coptions.i */
  187.     setdecompression coptions.i
  188.     getdecompression
  189.     if result ~= coptions.i then do
  190.         say "setcompression " || coptions.i " failed; rc = " || rc
  191.         exit rc
  192.     end
  193.     call Delay(50)
  194. end i
  195.  
  196. 'speak "This is the end of the Ay Rexx demonstration and test."'
  197.  
  198. 'setinfogadget "ARexx test complete."'
  199.  
  200. exit 0
  201.  
  202.  
  203. /*------------------------------------------------------------------*/
  204.  
  205. break_c:
  206.  
  207. say "*** Control-C recieved.  Stopped by user. ***"
  208. exit 5
  209.  
  210. /*------------------------------------------------------------------*/
  211.  
  212. error:
  213.  
  214. say "Error"
  215. exit 6
  216.  
  217. /*------------------------------------------------------------------*/
  218.  
  219.